<template>
  <a-drawer
    width="55%"
    :title="formTitle"
    :label-col="4"
    :wrapper-col="14"
    :visible="open"
    :body-style="{ height: 'calc(100vh - 100px)', overflow: 'auto' }"
    @close="cancel"
  >
    <a-form-model ref="form" :model="form" :rules="rules" layout="vertical">
      <a-spin :spinning="spinning" :delay="delayTime" tip="Loading...">
        <a-row :gutter="32" style="width: 80%; margin-left: 10%">
          <a-col :span="12">
            <a-form-model-item label="考核项目" prop="assessItem">
              <a-select
                placeholder="请选择考核项目"
                v-model="form.assessItem"
                :getPopupContainer="
                  (triggerNode) => {
                    return triggerNode.parentNode || document.body;
                  }
                "
                style="width: 100%"
                allow-clear
                :disabled="isEdit"
              >
                <a-select-option
                  v-for="(d, index) in assessItemOptions"
                  :key="index"
                  :value="d.dictValue"
                  >{{ d.dictLabel }}</a-select-option
                >
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="最高得分" prop="assessScore">
              <a-input-number
                v-model="form.assessScore"
                :min="0"
                :max="100"
                style="width: 100%"
                :disabled="isEdit"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="考核指标" prop="assessTitle">
              <a-textarea
                v-model="form.assessTitle"
                placeholder="请输入考核指标"
                :rows="4"
                :disabled="isEdit"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="考核标准" prop="assessContent">
              <a-textarea
                v-model="form.assessContent"
                placeholder="请输入考核标准"
                :rows="4"
                :disabled="isEdit"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="评分标准" prop="assessMark">
              <a-textarea
                v-model="form.assessMark"
                placeholder="请输入评分标准"
                :rows="4"
                :disabled="isEdit"
              />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-spin>
      <div class="bottom-control">
        <a-space v-if="!isEdit">
          <a-button @click="cancel"> 取消 </a-button>
          <a-button type="primary" @click="submitForm"> 保存 </a-button>
        </a-space>
        <a-space v-else>
          <a-button @click="cancel"> 关闭 </a-button>
        </a-space>
      </div>
    </a-form-model>
  </a-drawer>
</template>
<script>
import BizAssessDetailsInfoEditForm from "./BizAssessDetailsInfoForm";
export default {
  ...BizAssessDetailsInfoEditForm,
};
</script>
